//  轮播图
var num=0;
$(function(){
	var time = setInterval(fun,3000)
})

function fun(){
	num++;
	if(num>=$('.imgs>img').length-1){
		num=0;
	}
	$('.imgs>img').eq(num).css('opacity','1').siblings('img').css('opacity','0');
		$('.imgs>ul>li').eq(num).css('background','#ccff66').siblings().css('background','transparent')
}


//新闻资讯轮播图
var gly = document.querySelector('.glyphicon-chevron-left')
var gly1 = document.querySelector('.glyphicon-chevron-right')
var images = document.querySelector('.xinwen4')
var image = document.querySelector('.xinwen3')
var xiao = document.querySelector('.xinwen4>div')

var xiaode = xiao.offsetWidth


gly1.onclick=function(){
	console.log(1)
	fun1()
}
var num1  = 0;
function fun1(){
	xiaode = xiao.offsetWidth
	
    num1++;
	images.style.marginLeft=-xiaode*num1+'px'
	if(num1>3){
	images.style.marginLeft='0px'
	num1=0;
    
}}
gly.onclick=function(){
	xiaode = xiao.offsetWidth
	
	num1--;
	images.style.marginLeft=-xiaode*num1+'px'
	if(num1<0){
		images.style.marginLeft=-xiaode*3+'px'
		num1=3;
	}
}


